package ru.dveriwell.intra.finplan.ui.vo;

import java.math.BigDecimal;
import java.util.Calendar;

import ru.dveriwell.intra.finplan.domain.Planrequest;
import ru.dveriwell.intra.finplan.domain.Planunit;

public class UIRequest {
	
	private Planunit unit;
	private Planrequest request;
	
	public void setRequest(Planrequest request) {
		this.request = request;
	}
	
	public UIRequest() {
		this.unit = new Planunit();
		this.request = new Planrequest();
	}
	
	public UIRequest(Planunit unit, Planrequest request) {
		this.unit = unit;
		this.request = request;
	}
	
	public String getCommonname() {
		return unit.getCommonname();
	}

	public Integer getId() {
		return unit.getId();
	}

	public void setId(Integer id) {
		unit.setId(id);
	}

	public Integer getParentid() {
		return unit.getParentid();
	}

	public void setParentid(Integer parentid) {
		unit.setParentid(parentid);
	}

	public String getUnitcode() {
		return unit.getUnitcode();
	}

	public void setUnitcode(String unitcode) {
		unit.setUnitcode(unitcode);
	}

	public String getUnitname() {
		return unit.getUnitname();
	}

	public void setUnitname(String unitname) {
		unit.setUnitname(unitname);
	}
	
	public String getRequestcomment() {
		return request.getRequestcomment();
	}

	public void setRequestcomment(String requestcomment) {
		request.setRequestcomment(requestcomment);
	}

	public BigDecimal getRequestqty() {
		return request.getRequestqty();
	}

	public void setRequestqty(BigDecimal requestqty) {
//		if (requestqty.compareTo(new BigDecimal(0)) > 0)
//			System.out.println(Calendar.getInstance().getTime().toString() + ": setRequestqty(" + requestqty.toString() + ")");
		request.setRequestqty(requestqty);
	}

}
